<?php 
	if (isset($_POST['CapNhat']))
	{
		$MaSanPham = $_REQUEST['MaSanPham'];
		$MaThuongHieu = $_REQUEST['MaThuongHieu'];
		$TenSanPham =$_REQUEST['TenSanPham'];
		$NgayNhap = $_REQUEST['NgayNhap'];
		$MoTa = $_REQUEST['MoTa'];
		$DonGia = $_REQUEST['DonGia'];
		$TinhTrang = $_REQUEST['TinhTrang'];	
		$MaLoai=$_REQUEST['MaLoai'];
		$KhuyenMai = $_REQUEST['MaKhuyenMai'];
		$name="../Another/Images/SanPham/".$_FILES['HinhAnh']['name'];	
		include "connection.php";
		$sql="UPDATE sanpham SET MaLoai='".$MaLoai."', MaThuongHieu='".$MaThuongHieu."', TenSanPham='".$TenSanPham."',
		NgayNhap='".$NgayNhap."', MoTa='".$MoTa."',
		HinhAnhSP='".$name."', DonGiaDuKien='".$DonGia."', TinhTrang='".$TinhTrang."',MaKhuyenMai='".$KhuyenMai."'
		WHERE MaSanPham='" .$MaSanPham."'";
		if (!mysql_query($sql))
		{
			die('Error: ' . mysql_error());
		}
		header("location:../MyModel/TrangAD_qlsanpham.php");
		mysql_close($con);
	}
?>